<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 微信图片素材
 */
class CreateWechatImage extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wechat_image', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('attachment_id')->comment('附件表主键ID');
            $table->integer('wechat_image_group_id')->comment('图片素材分组主键ID');
            $table->string('name')->comment('图片名');
            $table->string('url')->comment('图片地址');
            $table->string('mediaId')->default('')->comment('微信媒体ID');
            $table->timestamp('mediaTime')->nullable()->comment('微信媒体过期时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('wechat_image');
    }
}
